<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<h:head></h:head>

	<h:body>
		<h:form>  
  
    <p:dataTable id="tbl" 
    			var="TabelaJuridica" 
    			value="#{juridicaAction.listaJuridica}"
    			paginator="true" rows="4"  
                selection="#{juridicaAction.juridicaSelecionado}" 
                selectionMode="single"  
                onRowSelectUpdate="painel"
                onRowSelectComplete="seleciona.show()"
                emptyMessage="Não encontrado nenhum cadastro!!!"
                >  
  
        <f:facet name="header">  
           Lista de Clientes Pessoa juridica 
        </f:facet>  
  
        <p:column sortBy="#{TabelaJuridica.nomePessoa }" filterBy="#{TabelaJuridica.nomePessoa}">  
            <f:facet name="header">  
                <h:outputText value="Nome do Cliente Pessoa juridica" />  
            </f:facet>  
            <h:outputText value="#{TabelaJuridica.nomePessoa}" />  
        </p:column>  
  
        <p:column  >  
            <f:facet name="header">  
                <h:outputText value="Nº C.N.P.J:" />  
            </f:facet>  
            <h:outputText value="#{TabelaJuridica.cnpj}" />  
        </p:column>  
  
        <p:column >  
            <f:facet name="header">  
                <h:outputText value="E-mail" />  
            </f:facet>  
            <h:outputText value="#{TabelaJuridica.email}" />  
        </p:column>  
  
        
    </p:dataTable>  
  
   <p:dialog header="Pessoa Juridica selecionada"
    	      widgetVar="seleciona" 
    	      resizable="true"  
              width="500" 
              height="300"
              showEffect="explode" 
              hideEffect="explode">  
  
        <h:panelGrid id="painel" columns="2" cellpadding="4">  
  
              
  
            <h:outputText value="Nome:" />  
           
           
              <p:inputText value="#{juridicaAction.juridicaSelecionado.nomePessoa}" />  
  			
            <h:outputText value="CNPJ:" /> 
            <p:inplace editor="true"> 
            <h:inputText value="#{juridicaAction.juridicaSelecionado.cnpj}" />  
  			</p:inplace>
             
             
        </h:panelGrid>  
        <p:commandButton id="salvar" value="Salvar"    
                         actionListener="#{juridicaAction.salvarJuridicaSelecionada}"/>
    </p:dialog>  

	 <h:panelGrid columns="2">  
    
</h:panelGrid>
  

</h:form>  

   
	</h:body>



</html>